package com.hui.user_service.controller;

import com.hui.user_service.common.Result;
import com.hui.user_service.entity.User;
import com.hui.user_service.service.UserService;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@RequestMapping("/user")
public class UserController {
    @Resource
    private UserService userService;

    @RequestMapping("/save")
    public Result<User> save(User user) {
        userService.saveUser(user);
        return new Result<>(0, "", "保存成功", user);
    }

}
